home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_u_z / vxb102.zip / VXBTEST.ZIP / VXFORM3.FRM (.txt) < prev    next >
Visual Basic Form  |  1991-12-03  |  27KB  |  670 lines

  1. VXFORM3
  2. Aircraft Brokerage Customers
  3. Form1-
  4. Label1
  5. Tms Rmn
  6. Label2
  7. Last Name, First Name
  8. Tms Rmn
  9. Label3
  10. Company
  11. Tms Rmn
  12. CustCode
  13. Tms Rmn
  14. CustName
  15. Tms Rmn
  16. CustCompany
  17. Tms Rmn
  18. Label4
  19. Address
  20. Tms Rmn
  21. Label5
  22. Tms Rmn
  23. Label6
  24. State
  25. Tms Rmn
  26. CustAddress
  27. Tms Rmn
  28. CustCity
  29. Tms Rmn
  30. A    CustState
  31. Tms Rmn
  32. CustStateHelp
  33. Tms Rmn
  34. Label7
  35. Tms Rmn
  36. Label8
  37.     Res Phone
  38. Tms Rmn
  39. Label9
  40.     Bus Phone
  41. Tms Rmn
  42. Label10
  43. Tms Rmn
  44. CustZip
  45. Tms Rmn
  46. C    CustPhRes
  47. Tms Rmn
  48. D    CustPhBus
  49. Tms Rmn
  50. CustFax
  51. Tms Rmn
  52. Label11
  53. Created
  54. Tms Rmn
  55. Label12
  56. Days on File
  57. Tms Rmn
  58. BuyRecs
  59.     Bu&y Recs
  60. Tms Rmn
  61. Picture1
  62. 9    CustBuyer
  63. Buyer
  64. Tms Rmn
  65. CustSeller
  66. Seller
  67. Tms Rmn
  68. F    CustCdate
  69. Tms Rmn
  70. CustDays
  71. Tms Rmn
  72. Aircraft
  73.     Ai&rcraft
  74. Tms Rmn
  75. Label13
  76. Revised
  77. Tms Rmn
  78. G    CustRdate
  79. Tms Rmn
  80. CustSave
  81. &Save
  82. CustCancel
  83. &Cancel
  84. CustAdd
  85. CustDelete
  86. &Delete
  87. CustMemo
  88. &Memo
  89. CustNext
  90. &Next
  91. CustPrevious
  92.     &Previous
  93. CustBrowse
  94. &Browse
  95. CustExit
  96. E&xit
  97. Label14
  98. Status
  99. Tms Rmn
  100. CustStatus
  101. CustCode_Change
  102. Form_Click
  103.     Form_Load
  104. TypeReturn
  105. BROWSE_ADDV
  106. TypeDataCleara
  107. TypeStatusH
  108. TypeSave
  109. Enabled
  110. TypeCancel
  111. TypeAdd
  112. FALSE
  113. TypeDelete7
  114. BROWSE_EDITG
  115. CustReturnW
  116. CustDataClear
  117. CustStatus{
  118. CustSave
  119. CustCancel
  120. CustAdd
  121. CustDelete!
  122. CustMemo
  123. TypeDataLoad
  124. vxRecNod
  125. CustDataLoad
  126. TypeCodeL
  127. TypeDesc
  128. CustCode
  129. CustName
  130. CustCompany2
  131. CustAddressN
  132. CustCity{
  133.     CustState
  134. CustZip?
  135.     CustPhRes
  136.     CustPhBus
  137. CustFaxm
  138.     CustBuyer
  139. Value
  140. CustSeller
  141.     CustCdate
  142.     CustRdatee
  143. CustDays
  144. vxField
  145. EnableCustData
  146. vxTrue     
  147. vxDateFormat
  148. CreateDate
  149. DateCreated9
  150. DateCreate
  151. DateRev
  152. will1
  153. datesk
  154. DaysOnFile
  155. perform-
  156. DisableCustData
  157. CustCode_GotFocus
  158. BROWSE_DELETE
  159. vxDeleteRec
  160. CodeSize
  161. vxFieldSize
  162. hwndC
  163. GetFocus
  164. SendMessagea
  165. EM_LIMITTEXT-
  166. CustCode_KeyPress7
  167. KeyAscii
  168. CustName_ChangeX
  169. CustName_KeyPressp
  170. CustCompany_Change
  171. CustCompany_KeyPress
  172. CustAddress_Change
  173. CustAddress_KeyPress
  174. CustCity_Change
  175. CustCity_KeyPress
  176. CustZip_Change
  177. CustZip_KeyPress
  178. CustPhRes_Change*
  179. CustPhRes_KeyPress@
  180. CustPhBus_ChangeR
  181. CustPhBus_KeyPressf
  182. CustFax_Changez
  183. CustFax_KeyPress
  184. CustState_Change
  185. CustState_KeyPress
  186. CustName_GotFocus
  187. CustAddress_GotFocus
  188. CustCity_GotFocus
  189. CustState_GotFocus
  190. CustZip_GotFocus
  191. CustPhRes_GotFocus(
  192. CustPhBus_GotFocush
  193. CustFax_GotFocus4
  194. CustSave_ClickY
  195. SeekKey
  196. EmptyStringr
  197. vxSeekD    
  198. vxAppendBlank
  199. RString~
  200. vxReplString&
  201. vxWrite
  202. vxSelectDbf
  203. AirstateDbf
  204. AircustDbf
  205. IsBuyer
  206. ThenIsBuyerX
  207. IsSeller
  208. WasBuyer
  209.     WasSellero
  210. CDate
  211. RDate
  212. vxReplDateK
  213. CustStateHelp_Click
  214. VXFORM3
  215. VXFORM1;
  216. SaveReturn
  217. BROWSE_USER
  218. StateReturn0    
  219. vxBrowsew
  220. Airstat2NtxH
  221. vxSelectNtx;    
  222. Airstat1Ntx
  223. CustAdd_Click
  224. CustCancel_Click
  225. CustBrowse_Click
  226. BrowseCust)
  227. CustDelete_ClickF
  228. CustExit_Click
  229. VXFORM2
  230. CustNext_Click
  231. vxEof
  232. vxSkips
  233. TypeNext8
  234. TypePrev
  235. TypeBrowse
  236.     vxDeletedp
  237. vxBottomT
  238. CustNext
  239. CustPrevT    
  240. CustBrowsec    
  241. CustPrevious_Click
  242. vxBof
  243. vxTop
  244. Form_Unload
  245. Cancel
  246. AirtypesDbf
  247. vxTableReset
  248. vxClose
  249. table
  250. CustPrevious
  251. BROWSE_MISCw    
  252. CustSeller_Click
  253. CustBuyer_Click
  254. CustBuyer_KeyPress
  255. CustSeller_KeyPress
  256. Visible:
  257. Aircust1Ntx.
  258. NumRecsq
  259.     vxNumRecs
  260. aircraft
  261. BuyRecsb
  262. CustKey
  263.     RecNumber
  264. AirbuyerDbf
  265. vxUseDbfT
  266. Airbuy1Ntx`
  267. vxUseNtx
  268. Airbuy2Ntx
  269. OpenBuyerFile
  270.     BuyerOpenb
  271. RecNum&
  272. AircraftOpen
  273. Aircraf1Ntx
  274. StatesOpen
  275. BuyRecs_Click
  276. BofExpr
  277. EofExpr$
  278. vxTableDeclare=
  279. VX_RED
  280. Settingw
  281. scope
  282. index3
  283. determinesz
  284. action/
  285. vxTableField
  286. VX_FIELD
  287. going
  288. browse
  289. respectively
  290. b_code
  291. BrowseBuyers^
  292. BuyerReturn
  293. VXFORM4C
  294. BuyerRec
  295.     TypesOpen
  296. Aircraft_Click
  297. AircraftDbf
  298. Aircraf2Ntx
  299. AircraftReturn
  300. VXFORM5p
  301. BROWSE_CLOSED
  302. CursorWait
  303. CursorArrow
  304. CustMemo_Click
  305. vxMemoEdit
  306. DisableCustButtons
  307. parent
  308. disabled
  309. EnableCustButtons
  310. CustExit
  311. vxUnlock
  312. Total
  313. vxSum
  314. vxFilterc
  315. Form_Paint>
  316. vxFormFrameX
  317. BuyCodeL
  318. vxCtlStyle
  319. VX_RAISE
  320. BuyType
  321.     VX_RECESS
  322. BuyTypeDesc
  323. BuyLow
  324. BuyHighS
  325.     BuyStatus
  326. Picture1?
  327. Text1_ChangeI
  328. CurrHwnd
  329. SetFocusAPI
  330. TypeDelete_Click
  331. vxCtlLengthp
  332. CustCdate_Change'
  333. CustCompany_GotFocus6
  334. buyer
  335. status
  336. removef
  337. records
  338. seller
  339. record
  340.     OpenTypes
  341. OpenCust)
  342. OpenAircraft    
  343. LinkBuyToSell
  344. LinkSellToBuy
  345.     PackFiles
  346. TestCreate
  347. TestCopy
  348. TestDataCopy
  349.     FileStruc
  350. vxWindowDereg
  351. Form3Active
  352. field
  353. Form_Load
  354.  On form load analyze results of browse return
  355. Record addition request"
  356.  if user pressed ENTER then file is positioned
  357.  at current record and the record number isn
  358.  returned in CustReturn. In this case we assume
  359.  he wants to edit that record.
  360.  call general proc to load controlss
  361.  can't change keyA
  362. a_seller
  363. a_buyer"
  364. Edit record 
  365. CustDataClear
  366.  Clear Form in preparation for add or after successful deleteN
  367. dd-mmm-yyyy"
  368. dd-mmm-yyyy"
  369. CustDataLoad
  370.  Load data from customer recordd
  371.  ensure data entry enabled
  372.  extract field valuesl
  373. a_code
  374. a_name
  375. a_company"
  376. a_address"
  377. a_city
  378. a_state"
  379. a_zip"
  380. a_phoneres
  381. a_phonebus
  382. a_fax"
  383.  Return from logical field interrogation
  384.  vxTrue() is -1 (TRUE) or 0 (FALSE).
  385.  By using the unary negation operator
  386.  we will transform any -1 values to the 
  387.  checkbox value 1, which means "selected"
  388. a_buyer"
  389. a_seller
  390.  vxDateFormat() routine returns a date in theb
  391.  format dd-mmm-
  392. y, which the Visual Basic
  393.  DateValue function inderstands. We will put
  394.  the creation date into a variable so we can
  395.  perform some date arithmetic on it to determine
  396.  the number of days on filei
  397. a_cdate"
  398. a_rdate"
  399.  set customer key for other linkse
  400. EnableCustData
  401.  enables all data entry controls on the form
  402.  which are disabled by the CustCancel_Click Proc
  403. DisableCustData
  404.  Disables data entry when the cancel buttonn
  405.  is pressedd
  406. CustCode_GotFocus
  407.  set up text length limit-
  408. a_code#
  409. CustCode_KeyPress
  410.  Convert customer code to uppercase as it is being entered
  411.  also convert enter key to tab
  412. {Tab}"
  413. CustName_KeyPress
  414. {Tab}"
  415. CustCompany_KeyPress
  416. {Tab}"
  417. CustAddress_KeyPress
  418. {Tab}"
  419. CustCity_KeyPress
  420. {Tab}"
  421. CustZip_KeyPress
  422. {Tab}"
  423. CustPhRes_KeyPress
  424. {Tab}"
  425. CustPhBus_KeyPress
  426. {Tab}"
  427. CustFax_KeyPress
  428. {Tab}"
  429. CustState_KeyPress
  430. {Tab}"
  431. CustName_GotFocus
  432. a_name#
  433. CustAddress_GotFocus
  434. a_address"#
  435. CustCity_GotFocus
  436. a_city#
  437. CustState_GotFocus
  438. a_state"#
  439. CustZip_GotFocus
  440. a_zip"#
  441. CustPhRes_GotFocus
  442. a_phoneres#
  443. CustPhBus_GotFocus
  444. a_phonebus#
  445. CustFax_GotFocus
  446. a_fax"#
  447. CustSave_Click
  448.  Validate data when save button is pressed
  449.  verify something in the field
  450. Field cannot be empty"
  451.  verify unique key if adding
  452. Duplicate Key on Add
  453.  verify that state code is in states filef
  454.  on code
  455. State code not found
  456.  set vxbase logical values based ond
  457.  status of check box
  458.  if we're updating a record, save old buyer/seller
  459.  status in case we have to make adjustments to
  460.  the buyer and aircraft files if the status changesn
  461. a_buyer"
  462. a_seller
  463.  set up date strings in preparation for replacel
  464. dd-mmm-yyyy"
  465. dd-mmm-yyyy"
  466. a_cdate"
  467.  Data passed. Put it away
  468. a_code
  469. a_name
  470. a_company"
  471. a_address"
  472. a_city
  473. a_state"
  474. a_zip"
  475. a_phoneres
  476. a_phonebus
  477. a_fax"
  478. a_buyer"
  479. a_seller
  480. a_cdate"
  481. a_rdate"
  482.  we might have a new revision date
  483. a_rdate"
  484.  Update status box
  485. Record "
  486.  appended"
  487. Record "
  488.  saved
  489.  enable/display buyer/aircraft buttons
  490.  set global CustKey for links to buyer and aircraft filesi
  491.  save record numberr
  492.  Close states file to free some handlesd
  493.  also does vxTableReset-
  494.  Test old buyer status and remove records from buyer
  495.  file if he is no longer a buyer but once wasm
  496.  in VXBMOD.BAS
  497.  in cust code ordere
  498. Confirm delete of existing buyer records
  499. b_code
  500.  if delete denied then reset buyer status to truer
  501. a_buyer"
  502.  Test old seller status and remove record from aircraftr
  503.  file if he is no longer a seller but once was
  504.  in VXBMOD.BAS
  505.  in cust code order-
  506. Confirm delete of existing aircraft record
  507.  if delete denied then reset seller status to true
  508. a_seller
  509.  reopen states filef
  510.  in VXBMOD.BAS
  511.  Update Button Statusa
  512. CustStateHelp_Click
  513.  display a browse window on the state file. If the userr
  514.  double clicks a state or presses ENTER on a highlighted
  515.  record, we'll get the record number back and we can
  516.  stuff the state code into CustState.textt
  517.  on state name
  518. State and Provincial Abbreviations
  519.  after a browse, always re-register the database
  520.  with the window with a vxSelectDbf before attemptingt
  521.  to access a field in the help file.
  522. statecode"
  523. CustAdd_Click
  524.  clear form for addition of new record
  525. Record Addition Request"
  526.  ensure data entry enabled
  527.  reset the buttons
  528. CustCancel_Click
  529.  Clear form data and reset button status
  530. Operation cancelled"
  531.  we must disable data entry because the user
  532.  could enter a new record in the blank boxes
  533.  and then press the Add button. The TypeAdd_Click
  534.  routine clears the form boxes again prior tol
  535.  accepting input so the user's work would be lost
  536.  and he would be mad.h
  537. CustBrowse_Click
  538.  so we don't close files
  539.  when we unload the form
  540. CustDelete_Click
  541.  get user confirmation of delete
  542. Confirm Delete
  543.  we must also delete any attached buyer andy
  544.  aircraft recordsr
  545.  set global CustKey for links to buyer and aircraft files
  546.  save record number-
  547.  Close states file to free some handles-
  548.  also does vxTableReset-
  549.  delete buyer recordst
  550.  in VXBMOD.BAS
  551.  in cust code orderv
  552. b_code
  553.  delete aircraft record-
  554.  in VXBMOD.BAS
  555.  in cust code order-
  556.  reopen states filee
  557.  in VXBMOD.BAS
  558.  now delete the requested record
  559.  Deleted
  560. Delete failed"
  561. Delete cancelled
  562. CustExit_Click
  563.  current form is unloaded because if needed againd
  564.  the form_load proc must be invoked to reset the
  565.  control datad
  566. CustNext_Click
  567.  skip forward one record
  568.  if skip error, only allow exit-
  569. Error on Skip Next. Try Reindex.
  570.  test for end of file 
  571. End of File!
  572. Skipped to record 
  573.  rec unlocked here
  574. CustPrevious_Click
  575.  skip back one record
  576.  if skip error, only allow exit
  577. Error on Skip Previous. Try Reindex.
  578.  test for beginning of filer
  579. Beginning of File!
  580. Skipped to record 
  581. Form_Unload
  582.  close customer and state files and resete
  583.  table and restart menu window if we're'
  584.  NOT being unloaded by BrowseCustb
  585. CustBuyer_KeyPress
  586. {Tab}"
  587. CustSeller_KeyPress
  588. {Tab}"
  589. BuyRecs_Click
  590.  Close states file to free some handles
  591.  also does vxTableReset-
  592.  open airtypes file and buyer file
  593.  Set up browse table limited to buyer recordsn
  594.  that match the CustKey. We do this by sending
  595.  the vxTableDeclare proc a beginning ofr
  596.  file expression and an end of file expression.
  597. b_code < '
  598. b_code > '
  599.  The vxBrowse object now knows to limit theo
  600.  records in the table to those that have b_codec
  601.  values equal to CustKey. We also scope the records with the
  602.  "6" following the EofExpr and set the quick key index tox
  603.  "7". An explanation follows:t
  604.  The key we are going to use to browse this file isi
  605.  b_code + b_cat, whose elements are 6 long and 3 longl
  606.  respectively.  Every record we are interested in has the 
  607.  same b_code (i.e., they all belong to the same customer).
  608.  Setting the scope index to 6 determines the action to beb
  609.  taken when the HOME or END keys are depressed. The normal
  610.  value is 0, which takes you to the first and last logical
  611.  records in the file when HOME or END is hit. If other thant
  612.  zero, then the HOME key will result in a softseek on the 
  613.  file to the current key for the length specified by the
  614.  scope index. The END key will softseek to the current key
  615.  plus 1 and then skip back one record to position the 
  616.  record pointer to the last record in the group.
  617.  The quick index is set to 7, which is the first positiont
  618.  of the aircraft type code in the key. We aren't evene
  619.  going to display the b_code for the buyer records. Settingt
  620.  the quick index to 7 means that the common part of the key 
  621.  for the group of records we are interested in (the firsti
  622.  6 which form the customer code), will be prepended to the
  623.  quick keys entered at the keyboard before a seek is doned
  624.  on the file. Makes sense, huh?o
  625.  When scoping a file in this fashion, the only thing you
  626.  MUST do is position the record pointer to the first
  627.  record in the group and then pass that record numberm
  628.  to the vxBrowse proc (the StartRec& parameter).
  629. b_cat"
  630. Description"
  631. b_desc
  632. b_low"
  633. b_high
  634.  Because we are interested in only a subset of the possiblei
  635.  records in the buyer file, we have to determine ourselves
  636.  whether there are any records in the file that match the 
  637.  group. If not, we ask the user if he wants to add a record.
  638.  vxBrowse normally does this, but the file must be empty
  639.  before it asks the question and sets the return value
  640.  accordingly.g
  641.  global var2
  642.  set for browse start reco
  643. No buyer records. Add?
  644. Aircraft_Click
  645.  there is only one aircraft sell record allowedx
  646.  to a customer so this makes it a little simpler
  647.  Close states file to free some handlese
  648.  also does vxTableReset-
  649.  open airtypes file and aircraft file-
  650. \vb\vxbtest\aircraft.dbf
  651. Error Opening aircraft.dbf. Aborting."
  652. \vb\vxbtest\aircraf1.ntx
  653. \vb\vxbtest\aircraf2.ntx
  654. No aircraft records. Add?"
  655. CustMemo_Click
  656.  Edit memo. Always have an ENABLED form showing to act aso
  657.  parent to the memo window. It also must have the focus.
  658.  Copy the code below EXACTLY to ensure successful memoedits.
  659.  save rec num to goto later
  660.  make sure form has focus
  661. a_memo#
  662.  reset rec bufferN
  663.  unlock the record
  664. Form_Paint
  665.  if delete request from browse, do it now
  666.  because we must let enhanced controls
  667.  paint before asking for delete confirmation
  668. CustCompany_GotFocus
  669. a_company"#
  670.